#ifndef REGISTRO_H
#define REGISTRO_H

#include <iostream>
#include <time.h>

//EL PREFIJO TC ES TIPOCAMPO
typedef unsigned int TCId;
typedef time_t TCTimeStamp;
typedef unsigned int TCLongitudRegistroVariable; //el primer bit es usado para indicar si esta activo
typedef unsigned int TCOffsetEnArchivo;
typedef unsigned int TCLongitud;
typedef unsigned int TCPosicionEnLista;
typedef bool TCBooleano;

class Registro
{
        private:
                char* buffer;
                unsigned short tamanioBuffer;

        protected:
                unsigned short offsetBuffer;

        public:
                Registro();
                virtual ~Registro();

                char* getBuffer() const;
                unsigned short getTamanioBuffer() const;

                void setTamanioBuffer(unsigned short tamanioBuffer);
                bool setBuffer(char* buffer);

                bool crearBuffer();
                bool limpiarBuffer();

                void putIntoBuffer(void* source, unsigned short size);
                void getFromBuffer(void* target, unsigned short size);

                virtual void fillBuffer() = 0;
                virtual void readFromBuffer() = 0;

};


#endif


